<!doctype html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <title>游戏交友</title>
    <link rel="stylesheet" href="__JS__/mescroll.min.css">
    <style>
        * {
            padding: 0;
            margin: 0;
            list-style: none;
        }

        a:link, a:visited, a:hover, a:active {
            text-decoration: none;
        }

        a, a:hover, a:active, a:visited, a:link, a:focus {
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
        }

        .ptit1 {
            width: 100%;
            height: 3rem;
            border-bottom: 1px #eee solid;
            text-align: center;
            line-height: 3rem;
            font-size: 1.125rem;
            position: relative;
            background-color: #f8f8f8
        }

        .ab1 {
            width: 1.5rem;
            height: 1.5rem;
            position: absolute;
            left: .8rem;
            top: .8rem;
            background: url() center no-repeat;
            background-size: 100%;
        }

        .ptit2 {
            width: 100%;
            height: 2rem;
            text-align: center;
            font-size: .75rem;
            background-color: #fff0dd;
            line-height: 2rem
        }

        .txtc1 {
            color: #ef708c
        }

        .vodlist {
            /*padding-top: 5rem;*/
        }

        .vodlist ul li {
            border-bottom: 8px #f2f2f2 solid;
            display: block;
            padding: 1rem 0 1rem 1rem;
            overflow: hidden
        }

        .imgbs1 {
            width: 8rem;
            height: 8rem;
            background-color: #f8f8f8;
            border-radius: .5rem;
            float: left;
            position: relative
        }

        .imgbs1 img {
            width: 100%;
            height: 100%;
            border-radius: .5rem
        }

        .imgbs1 a {
            display: block;
            position: absolute;
            width: 2rem;
            height: 2rem;
            background-image: url();
            background-repeat: no-repeat;
            background-position: center;
            background-size: 100%;
            left: 50%;
            top: 50%;
            margin: -1rem 0 0 -1rem;
            z-index: 9
        }

        .vodlist ul li h2 {
            width: auto;
            font-size: .875rem;
            display: block;
            color: #111
        }

        .text1 {
            width: auto;
            height: auto;
            font-size: .75rem;
            color: #333;
            padding-top: .3rem
        }

        .text2 {
            width: auto;
            height: auto;
            font-size: .75rem;
            overflow: hidden;
            padding-top: .3rem;
            padding-bottom: .5rem
        }

        .text3 {
            width: auto;
            height: auto;
            font-size: .75rem;
            overflow: hidden;
            color: #9B9B9B;
            padding-top: .3rem
        }

        .text0 {
            float: left;
            width: auto;
            padding-left: 8px;
            overflow: hidden
        }

        .text0 .label1, .text0 .label2, .text0 .label3 {
            display: inline-block;
            float: left;
            font-size: .75rem;
            padding: .1rem .3rem;
            margin-right: .5rem;
            border-radius: .2rem
        }

        .text0 .label1 {
            background-color: #FFF0DD;
            color: #FFB852;
        }

        .text0 .label2 {
            background-color: #EFE7FF;
            color: #A67BFF;
        }

        .text0 .label3 {
            background-color: #FFD1DB;
            color: #FF7292;
        }

        .text0 .ax {
            background-color: #EA3D65;
            color: #fff;
            font-size: .75rem;
            display: inline-block;
            padding: .3rem .5rem;
            border-radius: .2rem;
        }

        .lo1 {
            height: 1rem;
            position: absolute;
            bottom: .3rem;
            right: .3rem;
            font-size: .75rem;
            color: #fff;
            padding: 0 0 0 1.25rem;
            background-image: url();
            background-repeat: no-repeat;
            background-size: 1rem;
            background-position: left;
            z-index: 1;
            line-height: normal
        }

        .contact {
            width: 100vw;
            height: 100vh;
            background-color: rgba(0, 0, 0, .65);
            position: fixed;
            left: 0;
            top: 0;
            z-index: 999;
            display: none;
        }

        .bv1s {
            position: absolute;
            width: 20rem;
            height: 12rem;
            left: 50%;
            top: 50%;
            margin: -6rem 0 0 -10rem;
        }

        .ghx {
            width: 100%;
            height: auto;
            background-color: #fff;
            border-radius: .8rem;
            margin-bottom: 1rem;
            padding: 2rem 0;
            overflow: hidden;
        }

        .ghx p {
            line-height: 2rem;
            font-size: 1.125rem;
            padding-left: 2rem;
        }

        .ghx p a {
            color: #735EDF;
            margin-left: 1rem;
        }

        .close {
            width: 2rem;
            height: 2rem;
            margin: auto;
            background: url() center no-repeat;
            display: block;
            background-size: 100%;
        }

        .opx {
            width: 100%;
            font-size: 1.125rem;
            text-align: center;
            margin-bottom: 1rem;
        }

        .ghx .ncv {
            display: block;
            margin: auto;
            background-color: #735EDF;
            color: #fff;
            height: 2.5rem;
            line-height: 2.5rem;
            text-align: center;
            width: 16rem;
            border-radius: 2rem;
            font-size: .875rem;
        }

        .txtc1 a {
            color: #ef708c;
        }

        .action-area {
			    position: fixed;
			    z-index: 200;
			    bottom: 5.33333vw;
			    right: 5.33333vw;
			}

			a {
			    text-decoration: none;
			    -webkit-tap-highlight-color: transparent;
			}

			.action-area .item {
			    display: -webkit-box;
			    display: -webkit-flex;
			    display: flex;
			    width: 12.8vw;
			    height: 12.8vw;
			    border-radius: 50%;
			    -webkit-box-align: center;
			    -webkit-align-items: center;
			    align-items: center;
			    -webkit-box-pack: center;
			    -webkit-justify-content: center;
			    justify-content: center;
			    color: #fff;
			    background-color: #101010;
			    box-shadow: 0 0.8vw 2.66667vw 0 rgba(0,0,0,.23);
			}


    </style>
</head>
<body>

<div class="vodlist mescroll" id="mescroll">
    <div class="ptit1">游戏交友</div>
    <!--<div class="ptit2">VIP可查看联系方式，<span class="txtc1"><a href="javascript:" class="buy_vip">购买VIP</a></span></div>-->
    <ul id="js-list"></ul>
</div>

<div class="contact">
    <div class="bv1s">
        <div class="ghx">

        </div>
        <a class="close" href="javascript:"></a>
    </div>
</div>
<a class="action-area" href="#" onclick="add_girl()">
    <div class="item">

            <svg t="1600744450443" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3636" width="32" height="32"><path d="M853.333333 480H544V170.666667c0-17.066667-14.933333-32-32-32s-32 14.933333-32 32v309.333333H170.666667c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h309.333333V853.333333c0 17.066667 14.933333 32 32 32s32-14.933333 32-32V544H853.333333c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32z" p-id="3637" fill="#ffffff"></path></svg>

    </div>
</a>
<script id="tpl" type="text/html">
    <% for(i = 0; i < list.length; i++){ %>
    <li>
        <div class="imgbs1">
            <% if (list[i].girl_img) { %>
            <img src="<%= list[i].girl_img %>">
            <% } else { %>
            <img src="/public/static/img/girl.png">
            <% } %>
            <% if (list[i].girl_vod) { %>
            <a href="/pw_play?fid=<%= list[i].girl_vod %>"></a>
            <% } else { %>
            <a href="javascript:"></a>
            <% } %>
            <div class="lo1"><%= list[i].girl_look %></div>
        </div>
        <div class="text0">
            <h2><%= list[i].girl_name %></h2>
            <div class="text1"><%= list[i].girl_des %></div>
            <div class="text2">
                <% for(m = 0; m < list[i].girl_tag.length; m++){ %>
                <a href="javascript:" class="label<%= m+1 %>"><%= list[i].girl_tag[m] %></a>
                <% } %>
            </div>
            <a href="javascript:" data-id="<%= list[i].id %>" class="ax">加微信</a>
            <div class="text3">发布时间：<%= $imports.format(list[i].add_time) %>
                <span class="sp1"><%= $imports.path(list[i].province,list[i].city) %></span>
            </div>
        </div>
    </li>
    <% } %>
</script>
<script src="__JS__/jquery.min.js"></script>
<script src="__JS__/template-web.js"></script>
<script src="__JS__/mescroll.min.js"></script>
<script src="__JS__/common.js?v={$Think.config.commonJs}"></script>
<script>
    var mescroll = new MeScroll("mescroll", {
        down: {
            auto: false,
            offset: 50,
            outOffsetRate: 0.05,
            inOffsetRate: 0.35,
            callback: downCallback //下拉刷新的回调
        },
        up: {
            auto: true,
            callback: upCallback //上拉回调
        }
    });

    function downCallback(mescroll) {
        setTimeout(function () {
            $('#js-list').html('');
            mescroll.resetUpScroll(false);
        }, 150);
    }

    function upCallback(page) {
        var pageNum = page.num;
        var pageSize = page.size;

        $.ajax({
            url: '/pw_page',
            type: 'POST',
            dataType: 'json',
            data: {pageNum: pageNum, pageSize: pageSize},
            success: function (res) {
                mescroll.endBySize(res.data.length, res.totalSize);
                $('#js-list').append(template('tpl', {list: res.data}));
            },
            error: function (e) {
                mescroll.endErr();
            }
        });
    }

    $('.buy_vip').click(function () {
        if (!Cookies.get('user_token')) {
            window.android._login();
        } else {
            window.open("/buy_vod_vip", "_blank");
        }
    });

    $("#js-list").on('click', '.ax', function () {
        if (!Cookies.get('user_token')) {
            window.android._login();
        }

        _hmt.push(['_trackEvent', 'btn', 'click', 'jiaoyou', 1]);

        var id = $(this).data('id');
        $.ajax({
            url: '/pw_contact',
            type: 'GET',
            dataType: 'json',
            data: {id: id},
            success: function (res) {
                var str;
                if (res.code == 200) {
                    var girl_wx = res.data.girl_wx;
                    var girl_pwd = res.data.girl_pwd;

                    if (girl_pwd) {
                        str = '<p>微信号：' + girl_wx + '<a class="copy">复制</a></p> <p>加友口令：' + girl_pwd + '</p>';
                    } else {
                        str = '<p>微信号：' + girl_wx + '<a class="copy">复制</a></p>';
                    }

                    $('.ghx').html(str);

                    $(".copy").unbind().click(function () {
                        if (girl_pwd) {
                            window.android._copy('微信号：' + girl_wx + '\n' + '加友口令：' + girl_pwd);
                        } else {
                            window.android._copy('微信号：' + girl_wx + '\n');
                        }
                    });

                } else if (res.code == 403) {
                    str = '<div class="opx">查看她的微信号</div><a href="/buy_vod_vip" class="ncv">成为会员，获取更多查看次数</a>';
                    $('.ghx').html(str);
                } else {
                    showMsg(res.msg);
                    return false;
                }

                $('.contact').show();
                $('.contact .close').unbind().click(function () {
                    $('.contact').hide();
                })
            }
        });
    });

    template.defaults.imports.format = function (date) {
        return date.split(" ")[0];
    };

    template.defaults.imports.path = function (province, city) {
        province = province.replace("省", "").replace("市", "");
        city = city.replace("市", "");

        var str = province + '-' + city;
        if (str.length > 8) {
            str = str.substr(0, 8) + '...';
        }

        return str;
    };

    function add_girl(){
        if (!Cookies.get('user_token')) {
                window.android._login();
        }
        $.ajax({
            url: '/pw_girl_status',
            type: 'POST',
            dataType: 'json',
            data: {},
            success: function (response) {
                //console.log(response);
                if(response.code==200){
                    if(response.data!=-1){

                        window.open("/pw_girl_info", "_blank");
                    }else{
                        window.open("/pw_release", "_blank");

                    }
                }else{

                }
            },
            error: function (e) {
            }
        });
    }
</script>
<script>
    var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?bf36a1bc063e6437a30fb80573711ea5";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>
</body>
</html>
